import http from "@/utils/http"

const prefixUrl = "/userRoleMenu"
export default {
  prefixUrl: prefixUrl,
  role: {
    query:
      "GET:/userRoleMenu/:plat_abbreviation/:plat_code/:role_abbreviation/:role_code",
    update:
      "PUT:/userRoleMenu/:plat_abbreviation/:plat_code/:role_abbreviation/:role_code",
    cacheClean: "PUT:" + prefixUrl,
    export: "GET:" + prefixUrl,
    import: "POST:" + prefixUrl,
  },
  query(plat_abbreviation, plat_code, role_abbreviation, role_code) {
    return http.get(
      prefixUrl +
        "/" +
        plat_abbreviation +
        "/" +
        plat_code +
        "/" +
        role_abbreviation +
        "/" +
        role_code
    )
  },
  update(plat_abbreviation, plat_code, role_abbreviation, role_code, params) {
    return http.put(
      prefixUrl +
        "/" +
        plat_abbreviation +
        "/" +
        plat_code +
        "/" +
        role_abbreviation +
        "/" +
        role_code,
      params
    )
  },
  cacheClean(plat_abbreviation, plat_code, role_abbreviation, role_code) {
    return http.put(prefixUrl, {
      plat_abbreviation: plat_abbreviation,
      plat_code: plat_code,
      role_abbreviation: role_abbreviation,
      role_code: role_code,
    })
  },
  export() {
    return http.get(prefixUrl)
  },
  import() {
    return http.post(prefixUrl)
  },
}
